drop table jms_dm.dm_sqs_qiwei_complaint_network_summary_dt;
CREATE TABLE jms_dm.dm_sqs_qiwei_complaint_network_summary_dt
(
    duty_type             varchar(100) comment '责任类型:网点,第三方,中心',
    delivery_code         varchar(100) comment '派件员编码',
    network_code          varchar(100) comment '网点编码',
    delivery_name         varchar(100) comment '派件员名称',
    network_name          varchar(100) comment '网点名称',
    network_type          varchar(100) comment '网点类型:1-总部,2-代理区,3-加盟商,4-中心,5-集散点,6-网点',
    virt_code             varchar(100) comment '虚拟代理区code',
    virt_name             varchar(100) comment '虚拟代理区name',
    regional_id           varchar(100) comment '大区ID',
    regional_desc         varchar(100) comment '大区名称',
    manage_code           varchar(100) comment '管理大区名称',
    manage_name           varchar(100) comment '管理大区名称',
    agent_code            varchar(100) comment '代理区编码',
    agent_name            varchar(100) comment '代理区名称',
    fran_code             varchar(100) comment '加盟商编码',
    fran_name             varchar(100) comment '加盟商名称',
    center_code           varchar(100) comment '中心编码',
    center_name           varchar(100) comment '中心名称',
    provider_id           varchar(100) comment '省份ID',
    provider_desc         varchar(100) comment '省份',
    city_id               varchar(100) comment '城市ID',
    city_desc             varchar(100) comment '城市',
    area_id               varchar(100) comment '区域id',
    area_desc             varchar(100) comment '区域name',
    district_code         varchar(100) comment '片区code',
    district_desc         varchar(100) comment '片区desc',
    district_id           varchar(100) comment '片区id',
    complaint_cnt         int comment '客诉量',
    xijia_sign_num        int comment '虚假签收',
    over_time_num         int comment '超时效催件',
    have_take_no_send_num int comment '有揽未发',
    no_send_door_num      int comment '不送货上门',
    service_attitude_num  int comment '服务态度',
    money_problem_num     int comment '费用问题',
    out_complaint_num     int comment '外投诉意向',
    compensate_num        int comment '赔偿意向',
    reback_transfer_num   int comment '退转件票数',
    tak_cnt               int comment '收件量',
    arr_ctn               int comment '到件量',
    date_time             date comment '日期'
) ENGINE = OLAP DUPLICATE KEY(duty_type)
COMMENT "客诉明细网点各类型票量汇总"
PARTITION BY RANGE(date_time)
(START ("2023-05-01") END ("2023-06-10") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(network_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);